package com.dragon.repository.domain.dto;

import com.dragon.repository.entity.Calendared;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.dragon.common.util.BeanUtils;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CalendaredDTO {

    private static final long serialVersionUID = 1L;

    private Integer id;

    @ApiModelProperty(value = "阳历日")
    private Integer day;

    @ApiModelProperty(value = "节日描述")
    private String festivalList;

    @ApiModelProperty(value = "干支日")
    private String gzDate;

    @ApiModelProperty(value = "干支月")
    private String gzMonth;

    @ApiModelProperty(value = "干支年")
    private String gzYear;

    @ApiModelProperty(value = "当前日期：null为正常,1为节假日，2为补班日")
    private Integer status;

    @ApiModelProperty(value = "月份是否是：0不是，1是")
    private Integer isBigMonth;

    @ApiModelProperty(value = "农历日")
    private Integer lunarDate;

    @ApiModelProperty(value = "农历月")
    private Integer lunarMonth;

    @ApiModelProperty(value = "农历年")
    private Integer lunarYear;

    @ApiModelProperty(value = "阳历月")
    private Integer month;

    @ApiModelProperty(value = "当前时间")
    private LocalDateTime oDate;

    @ApiModelProperty(value = "禁忌描述")
    private String suit;

    @ApiModelProperty(value = "节日")
    private String term;

    @ApiModelProperty(value = "阳历年")
    private Integer year;

    @ApiModelProperty(value = "是否是工作日")
    private Boolean isWorkDay;


    public CalendaredDTO() {}

    public CalendaredDTO(Calendared entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static CalendaredDTO convert(Calendared entity) {
        return new CalendaredDTO(entity);
    }

    public static List<CalendaredDTO> convertList(List<Calendared> list) {
        List<CalendaredDTO> resultList = new ArrayList<>();
        for (Calendared entity : list) {
            resultList.add(new CalendaredDTO(entity));
        }
        return resultList;
    }}
